const recursionRoutes = function (allRouters, menuList) {
  let uthorityList = [];
  menuList.forEach((item) => {
    allRouters.forEach((v) => {
      if (item.name === v.meta.name) {
        if (v.children && v.children.length > 0) {
          v.children = recursionRoutes(v.children, item.children);
        }
        uthorityList.push(v);
      }
    });
  });
  return uthorityList;
};

export default recursionRoutes;
